//
//  StockMoreViewController.m
//  HZ_New_Stock
//
//  Created by gaotime on 16/4/12.
//  Copyright © 2016年 Zeroing. All rights reserved.
//

#import "HZStockMoreViewController.h"
#import "HZSingleStockViewController.h"
#import "config.h"
#import "ColorTools.h"
#import "QuoteLvOper.h"
#import "ShowFormat.h"
#import "AppInfo.h"
#import "QuoteOperTools.h"
#import "HZMoreStockList.h"
#import "stringTools.h"
#import "HZNavHeaderView.h"

#define DATA_GRID_PAGE_SIZE	25
#define TIMETOCONTINUE  1.5
#define PAGE_INFO_MSG_FIRS	@"当前为第一页"
#define PAGE_INFO_MSG_LAST	@"当前为最后一页"

extern QUOTELV_OPER *g_pQuoteOper;

@interface HZStockMoreViewController ()
@property (nonatomic, strong)HZNavHeaderView *pNavHeaderView;
@end

@implementation HZStockMoreViewController

@synthesize pMoreStockList,parentController,bIsStatusBarChange;

- (void)viewDidLoad {
  self.view.backgroundColor = [UIColor whiteColor];
  
  [self initNavView];
  if (pMoreStockList == nil) {
      pMoreStockList= [[MoreStockList alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-64)];
      pMoreStockList.GADragViewDelegate = self;
      pMoreStockList.parent = self;
      [self.view  addSubview:pMoreStockList];
  }
  
  pActIndView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0.0f, 0.0, 32.0f, 32.0f)];
  [pActIndView setCenter:CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/2)];
  [pActIndView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge];
  [self.view addSubview:pActIndView];
  
  m_CodeInfoArr = [[NSMutableArray alloc]initWithCapacity:25];
}

- (void)initNavView{
//    _pNavHeaderView = [[HZNavHeaderView alloc] initWithFrame:CGRectMake(0, 20, 150, 40)];
//    _pNavHeaderView.backgroundColor = [UIColor blueColor];
//    self.navigationItem.titleView = _pNavHeaderView;
}

- (void)setActIndView:(BOOL)b
{
  if (b) {
    [pActIndView startAnimating];
  }else {
    [pActIndView stopAnimating];
  }
}

- (void)viewWillAppear:(BOOL)animated{
  [super viewWillAppear:animated];
}

-(UIStatusBarStyle)preferredStatusBarStyle{
  return UIStatusBarStyleLightContent;
}

- (void)viewDidAppear:(BOOL)animated{
  [super viewDidAppear:animated];
  //取消息订阅
  [self cancelSubscribe];
  
    self.title = pTitleName;
  bIsUpdate = FALSE;
  NSString *title = pTitleName;
  pTitle.text = pTitleName;
  if(nThemeId == 0){
    pTitle.textColor = [UIColor whiteColor];
  }else{
    pTitle.textColor = _rgb2uic(0x8c96b4, 1);
  }
    
  [_pNavHeaderView updateTitleName:pTitleName];
  if ([title isEqualToString:@"BTex--换手率榜"] || [title isEqualToString:@"创业板--换手率榜"]) {
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"股票名称",@"现价",@"换手率", nil] withFirstCol:YES];
      [pMoreStockList setDefaultSort:YES];
//    [pMoreStockList setLastButtonText:@"换手率"];
  }else if ([title isEqualToString:@"BTex--量比榜"] || [title isEqualToString:@"创业板--量比榜"]){
//    [pMoreStockList setLastButtonText:@"量比"];
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"股票名称",@"现价",@"量比", nil] withFirstCol:YES];
      [pMoreStockList setDefaultSort:YES];
  }else if([title isEqualToString:@"上证基金"]||[title isEqualToString:@"深证基金"]||[title isEqualToString:@"开放式基金"]||[title isEqualToString:@"封闭式基金"]||[title isEqualToString:@"LOF"]||[title isEqualToString:@"ETF"]){
    //基金名称（含代码）    截止日期    单位净值
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"基金名称",@"截止日期",@"单位净值", nil] withFirstCol:YES];
    [pMoreStockList setDefaultSort:NO];
  }else if([title isEqualToString:@"全球okex"]){
//     okex名称      现价      涨幅
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"okex名称",@"现价",@"涨幅", nil] withFirstCol:NO];
    [pMoreStockList setDefaultSort:YES];
  }else if([title isEqualToString:@"中金所"]){
    //     okex名称      现价      涨幅
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"okex名称",@"现价",@"涨幅", nil] withFirstCol:YES];
    [pMoreStockList setDefaultSort:YES];
  }else if([title isEqualToString:@"上期所"]||[title isEqualToString:@"郑商所"]||[title isEqualToString:@"大商所"]){
   //  合约名称      发布日期      结算价
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"合约名称",@"发布日期",@"结算价", nil] withFirstCol:NO];
    [pMoreStockList setDefaultSort:NO];
  }else if([title isEqualToString:@"okex"]){
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"股票名称",@"现价",@"涨幅", nil] withFirstCol:YES];
    [pMoreStockList setDefaultSort:NO];
  }else{
    [pMoreStockList setTitle:[NSArray arrayWithObjects:@"股票名称",@"现价",@"涨幅", nil] withFirstCol:YES];
    [pMoreStockList setDefaultSort:YES];
  }
  
  [self setActIndView:YES];//加载转圈
  
  if ([title isEqualToString:@"okex"]) {
    //订阅新的okex
    nIDActInd=nIDIndex = QuoteLvOper_GetIndexData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_HSINDEXLIST, 0, TRUE, QUOTELV_OPER_TAG_INDEX);
  }else if ([title isEqualToString:@"BTex--涨幅榜"]) {
    nIDActInd=nIDMarket_ASC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1101, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if([title isEqualToString:@"创业板--涨幅榜"]){
    nIDActInd=nIDMarket_ASC_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1106, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"BTex--换手率榜"]){
    nIDActInd=nIDMarket_HS= QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1101, 0, QUOTELV_CUSTOM_HS, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"创业板--换手率榜"]){
    nIDActInd=nIDMarket_HS_CYB= QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1106, 0, QUOTELV_CUSTOM_HS, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"BTex--量比榜"]){
    nIDActInd=nIDMarket_LB= QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1101, 0, QUOTELV_CUSTOM_VR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"创业板--量比榜"]){
    nIDActInd=nIDMarket_LB_CYB= QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1106, 0, QUOTELV_CUSTOM_VR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"领涨行业"]){
    nIDActInd = nQuoteIndustryId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BORADINDEX,QUOTELV_BLOCK_INDUSTRY,0,QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"领涨地区"]){
    nIDActInd = nQuoteAreaId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),RQS_LV_BORADINDEX,QUOTELV_BLOCK_AREA,0,QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE,QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"领涨概念"]){
    nIDActInd = nQuoteConceptId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),        RQS_LV_BORADINDEX,QUOTELV_BLOCK_CONCEPT,0,QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
  }else if ([title isEqualToString:@"概念板块--详情"]||[title isEqualToString:@"地区板块--详情"]||[title isEqualToString:@"行业板块--详情"]){//订阅新的地区详细内容
    nIDActInd = nIDIAC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, nBID, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_IAC);
  }else if ([title isEqualToString:@"沪港通"]){
    //1816港股通 1813港股主板 1814港股创业 1815港股okex
    nIDActInd = nIDHKMarket = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1816, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_HK_GGT);
  }else if ([title isEqualToString:@"深港通"]){
    nIDActInd = nIDHKMarket_Main = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1813, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_HK_MAIN);
  }else if ([title isEqualToString:@"沪股通"]){
     nIDActInd = nIDHKMarket_CY = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1814, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_HK_CY);
  }else if ([title isEqualToString:@"深股通"]){
     nIDActInd = nIDHKMarket_Index = QuoteLvOper_GetIndexData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_HKINDEXLIST, 0, TRUE, QUOTELV_OPER_TAG_HK_INDEX);
  }else if([title isEqualToString:@"中金所" ]){
    //订阅新的okex
    nIDActInd = nIDFuturesStock = QuoteLvOper_GetIndexData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_SIFLIST, 0, TRUE, QUOTELV_OPER_TAG_FUTURES_STOCK);
    
  }else if ([title isEqualToString:@"BTexA股"]||[title isEqualToString:@"上证A股"]||[title isEqualToString:@"深证A股"]||[title isEqualToString:@"主板A股"]||[title isEqualToString:@"中小企业板"]||[title isEqualToString:@"创业板"]||[title isEqualToString:@"BTexB股"]||[title isEqualToString:@"上证B股"]||[title isEqualToString:@"深证B股"]||[title isEqualToString:@"BTexAB股"]||[title isEqualToString:@"三板市场"]||[title isEqualToString:@"风险警示板"]||[title isEqualToString:@"B股转H股"]||[title isEqualToString:@"上证50"]||[title isEqualToString:@"上证180"]||[title isEqualToString:@"深证成指"]||[title isEqualToString:@"深证100"]||[title isEqualToString:@"BTex300"]) {
    int blockId = 1101;
    if ([title isEqualToString:@"BTexA股"]) {
      blockId = 1101;
    }else if ([title isEqualToString:@"上证A股"]) {
      blockId = 1102;
    }else if ([title isEqualToString:@"深证A股"]) {
      blockId = 1103;
    }else if ([title isEqualToString:@"主板A股"]) {
      blockId = 1104;
    }else if ([title isEqualToString:@"中小企业板"]) {
      blockId = 1105;
    }else if ([title isEqualToString:@"创业板"]) {
      blockId = 1106;
    }else if ([title isEqualToString:@"BTexB股"]) {
      blockId = 1107;
    }else if ([title isEqualToString:@"上证B股"]) {
      blockId = 1108;
    }else if ([title isEqualToString:@"深证B股"]) {
      blockId = 1109;
    }else if ([title isEqualToString:@"BTexAB股"]) {
      blockId = 1110;
    }else if ([title isEqualToString:@"三板市场"]) {
      blockId = 1111;
    }else if ([title isEqualToString:@"风险警示板"]) {
      blockId = 1121;
    }else if ([title isEqualToString:@"B股转H股"]) {
      blockId = 99992005;
    }else if ([title isEqualToString:@"上证50"]) {
      blockId = 1112;
    }else if ([title isEqualToString:@"上证180"]) {
      blockId = 1113;
    }else if ([title isEqualToString:@"深证成指"]) {
      blockId = 1114;
    }else if ([title isEqualToString:@"深证100"]) {
      blockId = 1115;
    }else if ([title isEqualToString:@"BTex300"]) {
      blockId = 1116;
    }
    
    nIDActInd=nIDMarket_ASC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, blockId, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
    
  }else if([title isEqualToString:@"上证基金"]||[title isEqualToString:@"深证基金"]||[title isEqualToString:@"开放式基金"]||[title isEqualToString:@"封闭式基金"]||[title isEqualToString:@"LOF"]||[title isEqualToString:@"ETF"]){
    
    int blockId = 1;
    if ([title isEqualToString:@"上证基金"]) {
      blockId = 1;
    }else if ([title isEqualToString:@"深证基金"]) {
      blockId = 2;
    }else if ([title isEqualToString:@"开放式基金"]) {
      blockId = 3;
    }else if ([title isEqualToString:@"封闭式基金"]) {
      blockId = 4;
    }else if ([title isEqualToString:@"LOF"]) {
      blockId = 5;
    }else if ([title isEqualToString:@"ETF"]) {
      blockId = 6;
    }
    
    char *pUrl = GetUrl(URL_FUND, 0);
    pUrl = "http://112.124.27.71:8383/b2c/fundsrv.do?";
    //strcat(pUrl,"?");
    char *url = QuoteLvOper_GetFundListUrl(g_pQuoteOper, pUrl, blockId, DATA_GRID_PAGE_SIZE);
    nIDActInd = nIDFund = QuoteLvOper_GetFundListData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), url, 0, QUOTELV_OPER_TAG_FUND_LIST);
  }else if([title isEqualToString:@"上期所"]||[title isEqualToString:@"郑商所"]||[title isEqualToString:@"大商所"]){
    int blockId = 2;
    if ([title isEqualToString:@"上期所"]) {
      blockId = 3;
    }else if ([title isEqualToString:@"郑商所"]) {
      blockId = 4;
    }else if ([title isEqualToString:@"大商所"]) {
      blockId = 2;
    }
    char *pUrl = GetUrl(URL_TABLEINFO, 0);
    pUrl = "http://112.124.27.71:8383/b2c/tableinfo.do?";
    char *url = QuoteLvOper_GetFuturesListUrl(g_pQuoteOper, pUrl, blockId, DATA_GRID_PAGE_SIZE,1);
    nIDActInd = nIDShowFutures = QuoteLvOper_GetFundListData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), url, 0, QUOTELV_OPER_TAG_FUTURES);
    
  }else if([title isEqualToString:@"全球okex"]){
    char *pUrl = GetUrl(URL_GLOBAL, 0);
    pUrl = "http://112.124.27.71:8383/b2c/tableinfo.do?";
    char url[256];
    sprintf(url, "%sreskey=index",pUrl);
    nIDActInd = nIDGlobal = QuoteLvOper_GetFundListData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), url, 0, QUOTELV_OPER_TAG_GLOBAL_LIST);
  }
}

-(void)setViewData:(NSString *)aViewName{
    pTitle.text = aViewName;
    pTitleName = aViewName;
}

-(void)setBlockId:(NSString *)aBlockId{
  nBID = [aBlockId integerValue];
  //订阅新的地区详细内容
  nIDActInd = nIDIAC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, nBID, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_IAC);
}

- (void)viewDidDisappear:(BOOL)animated{
  [self.pMoreStockList clearData];
  [self.pMoreStockList doneLoadingTableViewData];
  [self cancelSubscribe];
}

void StockMoreViewController_ResedData(void *aself, void *p){
  HZStockMoreViewController *controller;
  controller = (__bridge HZStockMoreViewController*)aself;
  
  [controller update:p];
}

////////////////////////////////////////////
-(void)update:(void*)p
{
  [self setActIndView:NO];//加载转圈
  if (bRefreshPage) {
    bRefreshPage = NO;
//    [dataGridView.nGrid setIsReflash:TRUE];
  }
  
  QUOTELV_SUBSCRIBE_ITEM * item;
  item = (QUOTELV_SUBSCRIBE_ITEM*)p;
  
  if(item->Id==nIDMarket_ASC || item->Id==nIDMarket_ASC_CYB || item->Id==nIDIAC){
    [self blockUpdate:QUOTELV_OPER_TAG_BLOCK_MARKET];
  }else if(item->Id==nIDMarket_HS || item->Id==nIDMarket_HS_CYB){
    [self blockHSUpdate:QUOTELV_OPER_TAG_BLOCK_MARKET];
  }else if(item->Id==nIDMarket_LB || item->Id==nIDMarket_LB_CYB){
    [self blockLBUpdate:QUOTELV_OPER_TAG_BLOCK_MARKET];
  }else if(item->Id==nIDIndex){
    [self calcIndexAD:QUOTELV_OPER_TAG_INDEX];
  }else if(item->Id==nQuoteIndustryId || item->Id == nQuoteAreaId|| item->Id == nQuoteConceptId){
    [self iacUpdate:QUOTELV_OPER_TAG_BLOCK_MARKET];
  }else if(item->Id==nIDHKMarket){
    [self blockUpdate:QUOTELV_OPER_TAG_HK_GGT];
  }else if(item->Id==nIDHKMarket_Main){
    [self blockUpdate:QUOTELV_OPER_TAG_HK_MAIN];
  }else if(item->Id==nIDHKMarket_CY){
    [self blockUpdate:QUOTELV_OPER_TAG_HK_CY];
  }else if(item->Id==nIDHKMarket_Index){
    [self calcIndexAD:QUOTELV_OPER_TAG_HK_INDEX];
  }else if(item->Id==nIDFuturesStock){
    [self calcIndexAD:QUOTELV_OPER_TAG_FUTURES_STOCK];
  }else if(item->Id==nIDFund){//基金
    QUOTELV_FUND_RES *pFundRes = (QUOTELV_FUND_RES *)item->pRes;
    [self setFundData:pFundRes withType:@"fund"];
  }else if(item->Id==nIDFutures){
    QUOTELV_FUND_RES *pFundRes = (QUOTELV_FUND_RES *)item->pRes;
    [self setFundData:pFundRes withType:@"future"];
  }else if (item->Id==nIDShowFutures){
    QUOTELV_FUND_RES *pFundRes = (QUOTELV_FUND_RES *)item->pRes;
    [self setFundData:pFundRes withType:@"showfuture"];
  }else if(item->Id==nIDGlobal){
    QUOTELV_FUND_RES *pFundRes = (QUOTELV_FUND_RES *)item->pRes;
    [self setFundData:pFundRes withType:@"global"];
  }
}

#pragma mark
#pragma mark ============================================
#pragma mark 自选股抽屉下拉消息响应

- (void)dragViewScrollToBottom:(UIView*)dragView{
  [self OnAction:(__bridge void *)(self) withType:ACTIVE_DATA_GRID_PRE withArg:0];
  [pMoreStockList dismissDragTableViewAnimation];
}

#pragma mark
#pragma mark ============================================
#pragma mark 自选股抽屉上拉消息响应

- (void)dragViewScrollToTop:(UIView*)dragView{
  [self OnAction:(__bridge void *)(self) withType:ACTIVE_DATA_GRID_NEXT withArg:0];
  [pMoreStockList dismissDragTableViewAnimation];
}

#pragma mark
#pragma mark ============================================
#pragma mark 自选股抽屉点击消息响应
- (void)dragView:(UIView*)dragView
didSelectRowAtIndexPath:(int)index{
  
  QUOTELV_OWN_RES *pOwnRes =  &g_pQuoteOper->OwnRes[QUOTELV_OPER_TAG_OWN];
  CODELV_INFO	*pCodeInfo = &pOwnRes->ownData[index].codeinfo;
  if (pCodeInfo){
    [parentController OnAction:(__bridge void *)(self) withType:ACTIVE_GO_MIN withArg:pCodeInfo];
  }
}

- (void) OnAction:(void *)mself withType:(int)type withArg:(void *)arg{
  switch (type) {
    case ACTIVE_DATA_GRID_PRE:
    case ACTIVE_DATA_GRID_NEXT:
    {
      bRefreshPage = YES;
      bIsUpdate = FALSE;
      
      if (nIDActInd == nIDIndex || nIDActInd == nIDHKMarket_Index) {
        return;
      }else if(nIDActInd == nIDMarket_ASC || nIDActInd == nIDMarket_ASC_CYB
               ||nIDActInd == nIDMarket_HS || nIDActInd == nIDMarket_HS_CYB
               ||nIDActInd == nIDMarket_LB || nIDActInd == nIDMarket_LB_CYB
               ||nIDActInd == nIDIAC || nIDActInd == nIDHKMarket
               ||nIDActInd == nIDHKMarket_CY || nIDActInd == nIDHKMarket_Main
               ||nIDActInd == nIDHKMarket_Index || nIDActInd == nQuoteConceptId
               ||nIDActInd == nQuoteAreaId || nIDActInd == nQuoteIndustryId){
        QUOTELV_BLOCK_ASK *pBlockAsk;
        QUOTELV_BLOCK_RES *pBlockRes;
        pBlockAsk = &g_pQuoteOper->BlockAsk[QUOTELV_OPER_TAG_BLOCK_MARKET];
        pBlockRes = &g_pQuoteOper->BlockRes[QUOTELV_OPER_TAG_BLOCK_MARKET];
        
        if (type==ACTIVE_DATA_GRID_PRE) {
          if (pBlockAsk->index==0) {
            [self showAlertPageInfo:PAGE_INFO_MSG_FIRS];
            break;
          }
          pBlockAsk->index -= DATA_GRID_PAGE_SIZE;
        }else {
          pBlockAsk->index += DATA_GRID_PAGE_SIZE;
        }
        if (pBlockAsk->index<0) {
          pBlockAsk->index = 0;
          //第一页
        }else if(pBlockAsk->index>=pBlockRes->nZTotalCount){
          pBlockAsk->index -= DATA_GRID_PAGE_SIZE;
          [self showAlertPageInfo:PAGE_INFO_MSG_LAST];
          return;
        }
        
        //取消息订阅
        [self cancelSubscribe];
        
        if (nIDActInd == nIDMarket_ASC) {
            nIDActInd = nIDMarket_ASC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, pBlockAsk->index, pBlockAsk->sortindex, pBlockAsk->sortmode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if(nIDActInd == nIDMarket_ASC_CYB){
            nIDActInd = nIDMarket_ASC_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, pBlockAsk->index, pBlockAsk->sortindex, pBlockAsk->sortmode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if(nIDActInd == nIDMarket_HS){
          nIDActInd = nIDMarket_HS = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, pBlockAsk->index, pBlockAsk->sortindex, pBlockAsk->sortmode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if(nIDActInd == nIDMarket_HS_CYB){
          nIDActInd = nIDMarket_HS_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, pBlockAsk->index, pBlockAsk->sortindex, pBlockAsk->sortmode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if(nIDActInd == nIDMarket_LB){
          nIDActInd = nIDMarket_ASC_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, pBlockAsk->index, pBlockAsk->sortindex, pBlockAsk->sortmode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if(nIDActInd == nIDMarket_LB_CYB){
          nIDActInd = nIDMarket_ASC_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, pBlockAsk->index, pBlockAsk->sortindex, pBlockAsk->sortmode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if(nIDActInd == nIDIAC){
          //订阅新的地区详细内容
          nIDActInd = nIDIAC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, nBID, pBlockAsk->index, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_IAC);
        }else if (nIDActInd == nQuoteIndustryId){
          nIDActInd = nQuoteIndustryId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),RQS_LV_BORADINDEX,QUOTELV_BLOCK_INDUSTRY,pBlockAsk->index,QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if (nIDActInd == nQuoteAreaId){
          nIDActInd = nQuoteAreaId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),RQS_LV_BORADINDEX,QUOTELV_BLOCK_AREA,pBlockAsk->index,QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE,QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if (nIDActInd == nQuoteConceptId){
          nIDActInd = nQuoteConceptId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),RQS_LV_BORADINDEX,QUOTELV_BLOCK_CONCEPT,pBlockAsk->index,QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
        }else if (nIDActInd == nIDHKMarket){
          //1816港股通 1813港股主板 1814港股创业 1815港股okex
          nIDActInd = nIDHKMarket = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1816, pBlockAsk->index, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_HK_GGT);
        }else if (nIDActInd == nIDHKMarket_Main){
          nIDActInd = nIDHKMarket_Main = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1813, pBlockAsk->index, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_HK_MAIN);
        }else if (nIDActInd == nIDHKMarket_CY){
          nIDActInd = nIDHKMarket_CY = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, 1814, pBlockAsk->index, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_HK_CY);
        }
      }else if(nIDActInd == nIDFund || nIDActInd == nIDGlobal || nIDActInd == nIDShowFutures){
        QUOTELV_FUND_RES *pFundRes = NULL;
        pFundRes = &g_pQuoteOper->FundRes[QUOTELV_OPER_TAG_FUND_LIST];
        
        if (pFundRes) {
          char sUrl[MAX_PATH];
          memset(sUrl,0,sizeof(sUrl));
          if (type==ACTIVE_DATA_GRID_PRE) {
            if (pFundRes->Page.nCurPage == 0) {
              [self showAlertPageInfo:PAGE_INFO_MSG_FIRS];
              return;
            }
            
            strcpy(sUrl, pFundRes->Page.pPrePageUrl);
          }
          else {
            if (pFundRes->Page.nCurPage >= pFundRes->Page.nPageCount - 1) {
              [self showAlertPageInfo:PAGE_INFO_MSG_LAST];
              return;
            }
            
            strcpy(sUrl, pFundRes->Page.pNextPageUrl);
          }
          
          if (strlen(sUrl)<=0) {
            break;
          }
          StringTools_DeleteString(sUrl, strlen(sUrl), "amp;");
          if(nIDActInd == nIDFund) {//基金
              nIDActInd = nIDFund = QuoteLvOper_GetFundListData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), sUrl, 0, QUOTELV_OPER_TAG_FUND_LIST);
          }else if(nIDActInd == nIDShowFutures){//期货
             nIDActInd = nIDShowFutures = QuoteLvOper_GetFundListData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), sUrl, 0, QUOTELV_OPER_TAG_FUTURES);
          }else if(nIDActInd == nIDGlobal){//全球
             nIDActInd = nIDGlobal = QuoteLvOper_GetFundListData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), sUrl, 0, QUOTELV_OPER_TAG_FUTURES);
          }	
        }
      }
    }
      break;
    case ACTIVE_DATA_GRID_CLICKED:
    {
//      NSString *title = self.navigationItem.title;
      NSString *title = pTitleName;
      if ([title isEqualToString:@"行业板块"]|| [title isEqualToString:@"地区板块"] || [title isEqualToString:@"概念板块"]  ) {
        title = [title stringByAppendingString:@"--详情"];
        self.navigationItem.title = title;
        //订阅新的地区详细内容
        nIDActInd = nIDIAC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, nBID, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_IAC);
        
        return;
      }
    }
      break;
    case ACTIVE_LIST_CLICKED:
    {
      NSString *title = pTitleName;
      
      if([title isEqualToString:@"上证基金"]||[title isEqualToString:@"深证基金"]||[title isEqualToString:@"开放式基金"]||[title isEqualToString:@"封闭式基金"]||[title isEqualToString:@"LOF"]||[title isEqualToString:@"ETF"] ||[title isEqualToString:@"全球okex"] ){
        return;
      }
        
      if ([title isEqualToString:@"行业板块"]|| [title isEqualToString:@"地区板块"] || [title isEqualToString:@"概念板块"]  ) {
        title = [title stringByAppendingString:@"--详情"];
        pTitle.text = title;
        NSArray *array = (__bridge NSArray *)(arg);
        if (array!=nil) {
          nBID = [(NSString*)[array lastObject] intValue];
        }
        [self cancelSubscribe];
        //订阅新的地区详细内容
        nIDActInd = nIDIAC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, nBID, 0, QUOTELV_CUSTOM_DR, QUOTELV_BLOCK_SORT_ASC, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_IAC);
        
        return;
      }
      
      if (arg){
        [parentController OnAction:(__bridge void *)(self) withType:ACTIVE_GO_MIN withArg:arg];
      }
    }
      break;
  }
}

-(void)blockUpdate:(int)n{
  NSMutableArray *datArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *colArray = [[NSMutableArray alloc] initWithCapacity:20];
  [m_CodeInfoArr removeAllObjects];
  
  QUOTELV_BLOCK_RES *pBlockRes;
  pBlockRes = &g_pQuoteOper->BlockRes[n];
  for (int i=0; i<pBlockRes->nTotalCount; i++)
  {
    QUOTELV_STOCK_POINT *pPoint = &pBlockRes->blockData[i];
    NSValue *codeValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    // 行情优化
    NSString *pZF = @"-";
    if (pPoint->fPre) {
      pZF = [NSString stringWithFormat:@"%0.2f%%",((pPoint->fHigh - pPoint->fLow)/pPoint->fPre)*100];
    }
    
    BOOL bBDZQ=FALSE;
    NSString* stockName; // 结果字符串
    NSString *string1 = [NSString stringWithUTF8String:pPoint->codeinfo.name];
    stockName = string1;
    
    NSArray *dataArray = [NSArray arrayWithObjects:
                          stockName,   //名称
                          [NSString stringWithUTF8String:pPoint->codeinfo.code],   //代码
                          D_PriShow(pPoint->fCur,pPoint->codeinfo.decNum),          //最新
                          DRShow(pPoint->fCur, pPoint->fPre),                   //涨跌幅
                          codeValue,    //股票信息结构
                          nil];
    
    UIColor *cName;
    UIColor *cCode;
    
//    if (QuoteLvOper_IsOwnCode(g_pQuoteOper, pPoint->codeinfo.code, pPoint->codeinfo.market)) {
//      cName = _rgb2uic(0x00deff,1);
//      cCode = _rgb2uic(0x00deff,1);
//    }else {
      cName = [UIColor blackColor];
      cCode = kMYHexToRGB(0x999999, 1);
//    }
    
    if (nThemeId == 1) {
      cName = _rgb2uic(0x8c96b4, 1);
      cCode = _rgb2uic(0x999999, 1);
    }
    
    NSArray *colorArray = [NSArray arrayWithObjects:
                                   cName,                                   //名称
                                   cCode,                                   //代码
                                   kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //最新
                                   kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //涨跌幅
                                   [UIColor blackColor],                                   //股票信息结构
                                   nil];
    
    NSValue *codeInfoValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    [m_CodeInfoArr addObject:codeInfoValue];
    
    [datArray addObject:dataArray];
    [colArray addObject:colorArray];
  }
  
  if (!bIsUpdate) {
    int nNum;
    int nCount;
    nNum = g_pQuoteOper->BlockAsk[n].index/DATA_GRID_PAGE_SIZE + 1;//add by xjl 05-05
    nCount = _mod(pBlockRes->nZTotalCount,DATA_GRID_PAGE_SIZE);
    [self.pMoreStockList setPageInfo:nNum withCount:nCount];
    bIsUpdate = TRUE;
  }
    [pMoreStockList setStockListData:datArray withColor:colArray];
}


-(void)iacUpdate:(int)n
{
  NSMutableArray *datArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *colArray = [[NSMutableArray alloc] initWithCapacity:20];
  [m_CodeInfoArr removeAllObjects];
  
  QUOTELV_BLOCK_RES *pBlockRes;
  pBlockRes = &g_pQuoteOper->BlockRes[n];
  for (int i=0; i<pBlockRes->nTotalCount; i++)
  {
    QUOTELV_STOCK_POINT *pPoint = &pBlockRes->blockData[i];
    
    // 行情优化
    NSString *pZF = @"-";
    if (pPoint->fPre) {
      pZF = [NSString stringWithFormat:@"%0.2f%%",((pPoint->fHigh - pPoint->fLow)/pPoint->fPre)*100];
    }

    NSArray *dataArray = [NSArray arrayWithObjects:
                          [NSString stringWithUTF8String:pPoint->codeinfo.name],   //名称
                          [NSString stringWithUTF8String:pPoint->codeinfo.code],   //代码
//                          [NSString stringWithFormat:@"%d",pPoint->codeinfo.market],    //市场
                          D_PriShow(pPoint->fCur,pPoint->codeinfo.decNum),          //现价
                          DRShow(pPoint->fCur, pPoint->fPre),                       //涨幅
                          [NSString stringWithFormat:@"%d",pPoint->BlockId],            //板块ID
//                          D_PriShowE(pPoint->fCur,pPoint->fPre,pPoint->codeinfo.decNum),//涨跌
                          nil];
    
    UIColor *cName;
    UIColor *cCode;
    
//    if (QuoteLvOper_IsOwnCode(g_pQuoteOper, pPoint->codeinfo.code, pPoint->codeinfo.market)) {
//      cName = _rgb2uic(0x00deff,1);
//      cCode = _rgb2uic(0x00deff,1);
//    }else {
      cName = [UIColor blackColor];
      cCode = [UIColor blackColor];
//    }
    
    if (nThemeId == 1) {
      cName = _rgb2uic(0x8c96b4, 1);
      cCode = _rgb2uic(0x8c96b4, 1);
    }
    
    NSArray *colorArray = [NSArray arrayWithObjects:
                           cName,                                   //名称
                           cCode,                                    //代码
                           kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //现价
                           kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //涨幅
//                           getColorRGW(pPoint->fCur, pPoint->fPre),                 //涨跌
//                           [UIColor lightGrayColor],                                //市场
                           [UIColor lightGrayColor],                                //板块ID
                           nil];
    
    NSValue *codeInfoValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    [m_CodeInfoArr addObject:codeInfoValue];
    
    [datArray addObject:dataArray];
    [colArray addObject:colorArray];
  }
  
    NSArray *titles = [NSArray arrayWithObjects:@"股票名称",@"股票代码",@"市场ID",@"板块ID",@"涨幅",@"现价",@"涨跌",nil];

    NSMutableArray *titleColor = [NSMutableArray arrayWithCapacity:10];
    for (NSString *s in titles) {
      [titleColor addObject:[UIColor blackColor]];
    }
    
    NSMutableArray *numArr = [NSMutableArray arrayWithObjects:[NSNumber numberWithInt:0], nil];
  
  if (!bIsUpdate) {
    int nNum;
    int nCount;
    nNum = g_pQuoteOper->BlockAsk[n].index/DATA_GRID_PAGE_SIZE + 1;//add by xjl 05-05
    nCount = _mod(pBlockRes->nZTotalCount,DATA_GRID_PAGE_SIZE);
    [self.pMoreStockList setPageInfo:nNum withCount:nCount];
    bIsUpdate = TRUE;
  }
      [pMoreStockList setStockListData:datArray withColor:colArray];
}

-(void)calcIndexAD:(int)n
{
  NSMutableArray *datArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *colArray = [[NSMutableArray alloc] initWithCapacity:20];
  
  QUOTELV_INDEX_RES *pIndexRes;
  pIndexRes = &g_pQuoteOper->IndexRes[n];
  for (int i=0; i<pIndexRes->nTotalCount; i++)
  {
    QUOTELV_STOCK_POINT *pPoint = &pIndexRes->indexData[i];
    NSValue *codeValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    
    // 行情优化
    NSString *pZF = @"-";
    if (pPoint->fPre) {
      pZF = [NSString stringWithFormat:@"%0.2f%%",((pPoint->fHigh - pPoint->fLow)/pPoint->fPre)*100];
    }
    
    NSArray *dataArray = [NSArray arrayWithObjects:
                          [NSString stringWithUTF8String:pPoint->codeinfo.name],   //名称
                          [NSString stringWithUTF8String:pPoint->codeinfo.code],   //代码
//                          [NSString stringWithFormat:@"%d",pPoint->codeinfo.market],    //市场
                          D_PriShow(pPoint->fCur,pPoint->codeinfo.decNum),          //现价
                          DRShow(pPoint->fCur, pPoint->fPre),                       //涨幅
//                          D_PriShowE(pPoint->fCur,pPoint->fPre,pPoint->codeinfo.decNum),//涨跌
                          codeValue,    //股票信息结构
                          nil];
    
    UIColor *cName;
    UIColor *cCode;
    
    //    if (QuoteLvOper_IsOwnCode(g_pQuoteOper, pPoint->codeinfo.code, pPoint->codeinfo.market)) {
    //      cName = _rgb2uic(0x00deff,1);
    //      cCode = _rgb2uic(0x00deff,1);
    //    }
    //    else {
    cName = [UIColor blackColor];
    cCode = _rgb2uic(0x999999, 1);
    //    }
    
    if (nThemeId == 1) {
      cName = _rgb2uic(0x8c96b4, 1);
      cCode = _rgb2uic(0x8c96b4, 1);
    }
    
    NSArray *colorArray = [NSArray arrayWithObjects:
                           cName,                                   //名称
                           cCode,                                    //代码
//                           [UIColor lightGrayColor],                                //市场
                           kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //涨幅
                           kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //现价
//                           getColorRGW(pPoint->fCur, pPoint->fPre),                 //涨跌
                           [UIColor blackColor],
                           nil];
    
    NSValue *codeInfoValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    [m_CodeInfoArr addObject:codeInfoValue];
    
    if((![[NSString stringWithUTF8String:pPoint->codeinfo.code] isEqualToString:@"399305"])
       &&(![[NSString stringWithUTF8String:pPoint->codeinfo.code] isEqualToString:@"1B0008"])
       &&(![[NSString stringWithUTF8String:pPoint->codeinfo.code] isEqualToString:@"399003"])
       &&(![[NSString stringWithUTF8String:pPoint->codeinfo.code] isEqualToString:@"399002"]))
    {
      [datArray addObject:dataArray];
      [colArray addObject:colorArray];
    }
  }
      [pMoreStockList setStockListData:datArray withColor:colArray];
}

-(void)blockHSUpdate:(int)n
{
  NSMutableArray *datArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *colArray = [[NSMutableArray alloc] initWithCapacity:20];
  [m_CodeInfoArr removeAllObjects];
  
  QUOTELV_BLOCK_RES *pBlockRes;
  pBlockRes = &g_pQuoteOper->BlockRes[n];
  for (int i=0; i<pBlockRes->nTotalCount; i++)
  {
    QUOTELV_STOCK_POINT *pPoint = &pBlockRes->blockData[i];
    NSValue *codeValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    // 行情优化
    NSString *pZF = @"-";
    if (pPoint->fPre) {
      pZF = [NSString stringWithFormat:@"%0.2f%%",((pPoint->fHigh - pPoint->fLow)/pPoint->fPre)*100];
    }
    
    BOOL bBDZQ=FALSE;
    NSString* stockName; // 结果字符串
    NSString *string1 = [NSString stringWithUTF8String:pPoint->codeinfo.name];
    stockName = string1;
//    if ([QuoteOperTools IsRStock:g_pQuoteOper withCode:pPoint->codeinfo.code withMacket:pPoint->codeinfo.market]) {
//      //标的证券
//      NSString *str = @"R";
//      str = [str stringByAppendingString:stockName];
//      stockName = str;
//      bBDZQ = TRUE;
//    }
    
    NSArray *dataArray = [NSArray arrayWithObjects:
                          stockName,   //名称
                          [NSString stringWithUTF8String:pPoint->codeinfo.code],   //代码
//                          [NSString stringWithFormat:@"%d",pPoint->codeinfo.market],    //市场
                          D_PriShow(pPoint->fCur,pPoint->codeinfo.decNum),          //现价
                          SwpShow(pPoint->nSwap),                                   //换手率
//                          DRShow(pPoint->fCur, pPoint->fPre),                       //涨幅
                          codeValue,    //股票信息结构
                          nil];
    
    UIColor *cName;
    UIColor *cCode;
    
//    if (QuoteLvOper_IsOwnCode(g_pQuoteOper, pPoint->codeinfo.code, pPoint->codeinfo.market)) {
//      cName = _rgb2uic(0x00deff,1);
//      cCode = _rgb2uic(0x00deff,1);
//    }else {
      cName = [UIColor blackColor];
      cCode = [UIColor blackColor];
//    }
    
    if (nThemeId == 1) {
      cName = _rgb2uic(0x8c96b4, 1);
      cCode = _rgb2uic(0x8c96b4, 1);
    }
    
    NSArray *colorArray = [NSArray arrayWithObjects:
                           cName,                                   //名称
                           cCode,                                    //代码
//                           [UIColor lightGrayColor],                                //市场
                           kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //现价
                           [UIColor blackColor],//换手率
//                           getColorRGW(pPoint->fCur, pPoint->fPre),                 //涨幅
                           [UIColor blackColor],//股票信息结构
                           nil];
    
    NSValue *codeInfoValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    [m_CodeInfoArr addObject:codeInfoValue];
    
    [datArray addObject:dataArray];
    [colArray addObject:colorArray];
  }
  
  if (!bIsUpdate) {
      int nNum;
      int nCount;
      nNum = g_pQuoteOper->BlockAsk[n].index/DATA_GRID_PAGE_SIZE + 1;//add by xjl 05-05
      nCount = _mod(pBlockRes->nZTotalCount,DATA_GRID_PAGE_SIZE);
      [self.pMoreStockList setPageInfo:nNum withCount:nCount];
      bIsUpdate = TRUE;
  }
  [pMoreStockList setStockListData:datArray withColor:colArray];
}

-(void)blockLBUpdate:(int)n
{
  NSMutableArray *datArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *colArray = [[NSMutableArray alloc] initWithCapacity:20];
  [m_CodeInfoArr removeAllObjects];
  
  QUOTELV_BLOCK_RES *pBlockRes;
  pBlockRes = &g_pQuoteOper->BlockRes[n];
  for (int i=0; i<pBlockRes->nTotalCount; i++)
  {
    QUOTELV_STOCK_POINT *pPoint = &pBlockRes->blockData[i];
    NSValue *codeValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    // 行情优化
    NSString *pZF = @"-";
    if (pPoint->fPre) {
      pZF = [NSString stringWithFormat:@"%0.2f%%",((pPoint->fHigh - pPoint->fLow)/pPoint->fPre)*100];
    }
    
    BOOL bBDZQ=FALSE;
    NSString* stockName; // 结果字符串
    NSString *string1 = [NSString stringWithUTF8String:pPoint->codeinfo.name];
    stockName = string1;
//    if ([QuoteOperTools IsRStock:g_pQuoteOper withCode:pPoint->codeinfo.code withMacket:pPoint->codeinfo.market]) {
//      //标的证券
//      NSString *str = @"R";
//      str = [str stringByAppendingString:stockName];
//      stockName = str;
//      bBDZQ = TRUE;
//    }
    
    NSArray *dataArray = [NSArray arrayWithObjects:
                          stockName,   //名称
                          [NSString stringWithUTF8String:pPoint->codeinfo.code],   //代码
//                          [NSString stringWithFormat:@"%d",pPoint->codeinfo.market],    //市场
                          D_PriShow(pPoint->fCur,pPoint->codeinfo.decNum),          //现价
//                          DRShow(pPoint->fCur, pPoint->fPre),                       //涨幅
                          EPShow(pPoint->nVolRate),                                 //量比
                          codeValue,    //股票信息结构
                          nil];
    
    UIColor *cName;
    UIColor *cCode;
    
//    if (QuoteLvOper_IsOwnCode(g_pQuoteOper, pPoint->codeinfo.code, pPoint->codeinfo.market)) {
//      cName = _rgb2uic(0x00deff,1);
//      cCode = _rgb2uic(0x00deff,1);
//    }else {
      cName = [UIColor blackColor];
      cCode = [UIColor blackColor];
//    }
    
    if (nThemeId == 1) {
      cName = _rgb2uic(0x8c96b4, 1);
      cCode = _rgb2uic(0x8c96b4, 1);
    }
    
    NSArray *colorArray = [NSArray arrayWithObjects:
                           cName,                                   //名称
                           cCode,                                    //代码
//                           [UIColor lightGrayColor],                                //市场
//                           getColorRGW(pPoint->fCur, pPoint->fPre),                 //涨幅
                           kMYGetZhangDieColor(pPoint->fCur, pPoint->fPre),                 //现价
                           [UIColor blackColor],//量比
                           [UIColor blackColor],//股票信息结构
                           nil];
    
    NSValue *codeInfoValue = [NSValue valueWithBytes:&pPoint->codeinfo objCType:@encode(CODELV_INFO)];
    [m_CodeInfoArr addObject:codeInfoValue];
    
    [datArray addObject:dataArray];
    [colArray addObject:colorArray];
  }

  if (!bIsUpdate) {
    int nNum;
    int nCount;
    nNum = g_pQuoteOper->BlockAsk[n].index/DATA_GRID_PAGE_SIZE + 1;//add by xjl 05-05
    nCount = _mod(pBlockRes->nZTotalCount,DATA_GRID_PAGE_SIZE);
    [self.pMoreStockList setPageInfo:nNum withCount:nCount];
    bIsUpdate = TRUE;
  }

    [pMoreStockList setStockListData:datArray withColor:colArray];
}

-(void) setFundData:(QUOTELV_FUND_RES*)pFundRes withType:(NSString *)pTypeName{
  if (pFundRes == nil) {
    return;
  }
  NSNumber *color;
  
  NSMutableArray *titleArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *colTitleArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *datArray = [[NSMutableArray alloc] initWithCapacity:20];
  NSMutableArray *colArray = [[NSMutableArray alloc] initWithCapacity:20];
  
  QUOTELV_FUND_COL *pCol;
  pCol = pFundRes->pColPro;
  if ([pTypeName isEqualToString:@"global"]) {
    for (int i=0; i<pFundRes->Page.nColCount-4; i++){
      [titleArray addObject:[NSString stringWithUTF8String:pCol->pText]];
      [colTitleArray addObject:[NSNumber numberWithInt:0x000000]];
      pCol = pCol+1;
    }
  }else{
    for (int i=0; i<pFundRes->Page.nColCount; i++){
      [titleArray addObject:[NSString stringWithUTF8String:pCol->pText]];
      [colTitleArray addObject:[NSNumber numberWithInt:0x000000]];
      pCol = pCol+1;
    }
  }
  
  QUOTELV_FUND_ROW *pRow;
  pRow = pFundRes->pRowPro;
  for (int i=0; i<pFundRes->Page.nRowCount; i++) {
    pCol = pRow->pCol;
    NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:20];
    NSMutableArray *colorArray = [[NSMutableArray alloc] initWithCapacity:20];
    
    if ([pTypeName isEqualToString:@"showfuture"]) {
      //名称 结算价 收盘价 涨跌幅 涨跌 发布日期
      for (int j=0; j<pFundRes->Page.nColCount; j++) {
        [dataArray addObject:[NSString stringWithUTF8String:pCol->pText]];
        //        NSString *str = [self ToHex:pCol->nTextColor];
        UIColor *color = _rgb2uic(pCol->nTextColor,1);
        if (pCol->nTextColor == 16776960) {//黄色
          color = [UIColor blackColor];
          if (nThemeId == 1) {
            color = _rgb2uic(0x8c96b4, 1);
          }
        }else if (pCol->nTextColor == 16777215) {//白色
          color = [UIColor blackColor];
          if (nThemeId == 1) {
            color = _rgb2uic(0x8c96b4, 1);
          }
        }

        [colorArray addObject:color];
        pCol = pCol+1;
      }
    }else if ([pTypeName isEqualToString:@"global"]) {
      for (int j=0; j<pFundRes->Page.nColCount-4; j++) {
        [dataArray addObject:[NSString stringWithUTF8String:pCol->pText]];
        UIColor *color = _rgb2uic(pCol->nTextColor,1);
        if (pCol->nTextColor == 16777215) {//白色
          color = [UIColor blackColor];
          if (nThemeId == 1) {
            color = _rgb2uic(0x8c96b4, 1);
          }
        }
        [colorArray addObject:color];
        //      [colorArray addObject:_rgb2uic(pCol->nTextColor,1)];//(UIColor*)[aColArr objectAtIndex:i];
        pCol = pCol+1;
      }
    }else{
      for (int j=0; j<pFundRes->Page.nColCount; j++) {
        [dataArray addObject:[NSString stringWithUTF8String:pCol->pText]];
        UIColor *color = _rgb2uic(pCol->nTextColor,1);
        if (pCol->nTextColor == 16776960) {//黄色
          color = [UIColor blackColor];
          if (nThemeId == 1) {
            color = _rgb2uic(0x8c96b4, 1);
          }
        }
        [colorArray addObject:color];
        pCol = pCol+1;
      }
    }
    
    [datArray addObject:dataArray];
    [colArray addObject:colorArray];
    pRow=pRow+1;
  }
  
  if ([pTypeName isEqualToString:@"fund"]) {
//    nType = ACTIVE_GRID_SHOW_FUND;
      NSMutableArray *showDataArray = [[NSMutableArray alloc] initWithCapacity:20];
      NSMutableArray *showColorArray = [[NSMutableArray alloc] initWithCapacity:20];
    
    for (int i=0; i<datArray.count; i++) {
      NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:10];
      NSMutableArray *colorArray = [[NSMutableArray alloc] initWithCapacity:10];
      
      //基金名称,截止日期,基金评级,单位净值,累计净值,周增长率,代码
      NSMutableString *pstr;
      NSArray *rowDataArray = datArray[i];
      NSArray *rowColorArray = colArray[i];
      //名字
      [dataArray addObject:rowDataArray[0]];
      [colorArray addObject:rowColorArray[0]];
      //代码
      [dataArray addObject:rowDataArray[6]];
      [colorArray addObject:rowColorArray[6]];
      //截止日期
      [dataArray addObject:rowDataArray[1]];
      [colorArray addObject:rowColorArray[1]];
      //单位净值
      [dataArray addObject:rowDataArray[3]];
      [colorArray addObject:rowColorArray[3]];
      //周增长率
      [dataArray addObject:rowDataArray[5]];
      [colorArray addObject:rowColorArray[5]];
      
      [showDataArray addObject:dataArray];
      [showColorArray addObject:colorArray];
    }
    
    if (!bIsUpdate) {
      int nNum;
      int nCount;
      nNum = pFundRes->Page.nCurPage;
      nCount =pFundRes->Page.nPageCount;
      [pMoreStockList setPageInfo:nNum+1 withCount:nCount];
      bIsUpdate = TRUE;
    }
    
    [pMoreStockList setStockListData:showDataArray withColor:showColorArray];
    
  }else if([pTypeName isEqualToString:@"future"]){
//    nType = ACTIVE_GRID_SHOW_FUTURES;
    for (int i=0; i<datArray.count; i++) {
      NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:10];
      NSMutableArray *colorArray = [[NSMutableArray alloc] initWithCapacity:10];
      
      NSArray *rowDataArray = datArray[i];
      //名字
      [dataArray addObject:rowDataArray[0]];
      [colorArray addObject:[NSNumber numberWithInt:0x055A5]];
      
      [pMoreStockList setStockListData:datArray withColor:colArray];
    }
  }else if([pTypeName isEqualToString:@"showfuture"]){
    NSMutableArray *showDataArray = [[NSMutableArray alloc] initWithCapacity:20];
    NSMutableArray *showColorArray = [[NSMutableArray alloc] initWithCapacity:20];
    
    for (int i=0; i<datArray.count; i++) {
      NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:10];
      NSMutableArray *colorArray = [[NSMutableArray alloc] initWithCapacity:10];
      
      //名称 结算价 收盘价 涨跌幅 涨跌 发布日期(合约名称      发布日期      结算价)
      NSMutableString *pstr;
      NSArray *rowDataArray = datArray[i];
      NSArray *rowColorArray = colArray[i];
      //合约名称
      [dataArray addObject:rowDataArray[0]];
      [colorArray addObject:rowColorArray[0]];
      //发布日期
      [dataArray addObject:rowDataArray[5]];
      [colorArray addObject:rowColorArray[5]];
      //结算价
      [dataArray addObject:rowDataArray[1]];
      [colorArray addObject:rowColorArray[1]];
      //涨跌幅
      [dataArray addObject:rowDataArray[3]];
      [colorArray addObject:rowColorArray[3]];
      
      [showDataArray addObject:dataArray];
      [showColorArray addObject:colorArray];
    }
    
    if (!bIsUpdate) {
      int nNum;
      int nCount;
      nNum = pFundRes->Page.nCurPage;
      nCount =pFundRes->Page.nPageCount;
      [pMoreStockList setPageInfo:nNum withCount:nCount];
      bIsUpdate = TRUE;
    }
    
    [pMoreStockList setStockListData:showDataArray withColor:showColorArray];
    
  }else if([pTypeName isEqualToString:@"global"]){
    if (!bIsUpdate) {
      int nNum;
      int nCount;
      nNum = pFundRes->Page.nCurPage;
      nCount =pFundRes->Page.nPageCount;
      [pMoreStockList setPageInfo:nNum withCount:nCount];
      bIsUpdate = TRUE;
    }
    
     [pMoreStockList setStockListData:datArray withColor:colArray];
  }
}

- (void)showAlertPageInfo:(NSString*)s{
  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:s delegate:nil cancelButtonTitle:@"确定"  otherButtonTitles:nil, nil];
  [alert show];
}

-(void)cancelSubscribe{
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDIndex);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDMarket_ASC);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDMarket_HS);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDMarket_LB);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDMarket_ASC_CYB);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDMarket_HS_CYB);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDMarket_LB_CYB);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDHKMarket);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDHKMarket_Main);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDHKMarket_CY);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDHKMarket_Index);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nQuoteIndustryId);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nQuoteAreaId);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nQuoteConceptId);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDFund);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDShowFutures);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDGlobal);
  QuoteLvOper_CancelSubscribe(g_pQuoteOper, nIDFuturesStock);
}

#pragma mark -
- (void)upToParentWithObjc:(id)objc withType:(NSInteger)type withParamter:(id)paramter{
    switch (type) {
        case kHZ_BlockListDetailClick_Action:
        {
            [self.parent upToParentWithObjc:objc withType:type withParamter:paramter];
        }
            break;
        case kHZ_jumpSingleStock_Action:
        {
            HZOwnedStockModel *model = nil;
            if ([paramter isKindOfClass:[HZOwnedStockModel class]]) {
                model = paramter;
            }
            HZSingleStockViewController *pSingleStockVC = [[HZSingleStockViewController alloc] initWithCodeInfo:model];
            pSingleStockVC.parent = self;
            [self.navigationController pushViewController:pSingleStockVC animated:YES];
        }
            break;
        case kHZ_ClickDataGridHead_Action:
        {
            int nSort = 0;
            int nIndex = [(NSString *)paramter intValue];
            
            if (nIDActInd == nIDMarket_ASC || nIDActInd == nIDMarket_ASC_CYB|| nIDActInd == nIDIAC || nIDActInd == nQuoteIndustryId || nIDActInd == nQuoteAreaId ||nIDActInd == nQuoteConceptId || nIDActInd == nIDIndex) {
                switch (nIndex) {
                    case 0://现价
                        nSort = QUOTELV_CUSTOM_NOW;
                        break;
                    case 1://涨幅
                        nSort = QUOTELV_CUSTOM_DR;
                        break;
                    default:
                        break;
                }
            }else if (nIDActInd == nIDMarket_HS || nIDActInd == nIDMarket_HS_CYB) {
                switch (nIndex) {
                    case 0://现价
                        nSort = QUOTELV_CUSTOM_NOW;
                        break;
                    case 1://换手率
                        nSort = QUOTELV_CUSTOM_HS;
                        break;
                    default:
                        break;
                }
            }else if (nIDActInd == nIDMarket_LB || nIDActInd == nIDMarket_LB_CYB) {
                switch (nIndex) {
                    case 0://现价
                        nSort = QUOTELV_CUSTOM_NOW;
                        break;
                    case 1://量比
                        nSort = QUOTELV_CUSTOM_VR;
                        break;
                    default:
                        break;
                }
            }
            
            int nMode = [pMoreStockList getSortMode];
            //取消息订阅
            [self cancelSubscribe];
            
            QUOTELV_BLOCK_ASK *pBlockAsk;
            pBlockAsk = &g_pQuoteOper->BlockAsk[QUOTELV_OPER_TAG_BLOCK_MARKET];
            
            if (nIDActInd == nIDMarket_ASC) {
                nIDActInd = nIDMarket_ASC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, 0, nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nIDMarket_ASC_CYB) {
                nIDActInd = nIDMarket_ASC_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, 0, nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nIDMarket_HS) {
                nIDActInd = nIDMarket_HS = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, 0, nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nIDMarket_HS_CYB) {
                nIDActInd = nIDMarket_HS_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, 0, nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nIDMarket_LB) {
                nIDActInd = nIDMarket_LB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, 0, nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nIDMarket_LB_CYB) {
                nIDActInd = nIDMarket_LB_CYB = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, pBlockAsk->blockid, 0, nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nQuoteIndustryId){
                nIDActInd = nQuoteIndustryId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),RQS_LV_BORADINDEX,QUOTELV_BLOCK_INDUSTRY,0,nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nQuoteAreaId){
                nIDActInd = nQuoteAreaId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),RQS_LV_BORADINDEX,QUOTELV_BLOCK_AREA,0,nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE,QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nQuoteConceptId){
                nIDActInd = nQuoteConceptId = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self),RQS_LV_BORADINDEX,QUOTELV_BLOCK_CONCEPT,0,nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_MARKET);
            }else if (nIDActInd == nIDIAC){//订阅新的地区详细内容
                nIDActInd = nIDIAC = QuoteLvOper_GetBlockData(g_pQuoteOper, StockMoreViewController_ResedData, (__bridge void *)(self), RQS_LV_BOARDRANK, nBID, 0, nSort, nMode, 0, TRUE, DATA_GRID_PAGE_SIZE, QUOTELV_OPER_TAG_BLOCK_IAC);
            }
        }
            break;
        default:
            break;
    }
}
- (void)downToChildWithObjc:(id)objc withType:(NSInteger)type withParamter:(id)paramter{
}
@end
